<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ include file="/WEB-INF/views/common.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html style="width:100%;height:100%">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Insert title here</title>
		<link rel="stylesheet" type="text/css" href="${cs}/css/xcConfirm.css"/>
		<script src="${cs}/js/jquery-1.9.1.js" type="text/javascript" charset="utf-8"></script>
		<script src="${cs}/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>
	<style type="text/css">
		.sgBtn{width: 135px; height: 35px; line-height: 35px; margin-left: 10px; margin-top: 10px; text-align: center; background-color: #0095D9; color: #FFFFFF; float: left; border-radius: 5px;}
		.vip{animation:change 5s linear 0s infinite;font-size:16px;font-weight:700;}
		@keyframes change{0%   {color:#333;}25%{color:#ff0;}50%{color:#f60;}75%{color:#cf0;}100% {color:#f00;}}
		
	</style>
	<script type="text/javascript">
	$(function(){
	$("#btn6").click(function(){
			var txt="请输入您要充值的金额";
			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.input,{
				onOk:function(v){
					if(!!v){
						var isNum=/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;
						if(isNum.test(v)){
							window.open("${cs}/pay.jsp");
							$.post("${cs}/cs/credit/member/recharge",{'money':v},function(r){
								if(r==1){
									window.wxc.xcConfirm('充值成功！', window.wxc.xcConfirm.typeEnum.success);
									setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
						   				 window.location.reload();//页面刷新
						   				 },2000);
								}else{
									window.wxc.xcConfirm('您的资金账户余额不足，请刷新查看！', window.wxc.xcConfirm.typeEnum.error);
								}
							},"json")
						}else{
							window.wxc.xcConfirm('输入不合法！', window.wxc.xcConfirm.typeEnum.error);
						}
					}else{
						window.wxc.xcConfirm('输入不合法！', window.wxc.xcConfirm.typeEnum.confirm);
					}
				}
			});
		});
		$("#btn7").click(function(){
			window.wxc.xcConfirm("请输入您要提现的金额", window.wxc.xcConfirm.typeEnum.input,{
				onOk:function(v){
					if(!!v){
						var isNum=/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;
						if(isNum.test(v)){
							window.wxc.xcConfirm("请输入您密码加上的身份证后六位", window.wxc.xcConfirm.typeEnum.input,{
								onOk:function(idcard){
									if(!!idcard){
											$.post("${cs}/cs/credit/member/drawing",{'money':v,'idcard':idcard},function(r){
												if(r==1){
													window.wxc.xcConfirm('提现成功！', window.wxc.xcConfirm.typeEnum.success);
													window.open("${cs}/get.jsp");
													setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
										   				 window.location.reload();//页面刷新
										   				 },2000);
												}else if(r==-1){
													window.wxc.xcConfirm('您的资金账户余额不足，请刷新查看！', window.wxc.xcConfirm.typeEnum.error);
												}else{
													window.wxc.xcConfirm('您输入的组合密码有误！！', window.wxc.xcConfirm.typeEnum.error);
												}
											},"json")
									}else{
										window.wxc.xcConfirm('输入不合法！', window.wxc.xcConfirm.typeEnum.confirm);
									}
								}
							});
						}else{
							window.wxc.xcConfirm('输入不合法！', window.wxc.xcConfirm.typeEnum.error);
						}
					}else{
						window.wxc.xcConfirm('输入不合法！', window.wxc.xcConfirm.typeEnum.confirm);
					}
				}
			});
		});
	})
	</script>
</head>
<body>
<div style="width:400px;height:180px;margin:auto auto">
	<table >
		<tr>
			
		</tr>
		<c:choose>
			<c:when test="${sessionScope.user.account.memberId!=null}">
				<td colspan="2">
					以下是您的资金明细：
				</td>
			</c:when>
			<c:otherwise>
				<td colspan="3" style="color:red;width:200px;">您还未注册会员，还不是本站的会员您将不能享受充值和提现功能，请先点击右上角的注册会员，缴纳1000元资金完成会员升级，此1000元将存入您的账户！</td>
			</c:otherwise>
		</c:choose>
		<tr>
			<td>您是尊敬的：</td><td class="vip" colspan="3">${account.memberName}</td>
		</tr>
		<tr>
			<td>您的开户时间为：</td><td  colspan="3"><fmt:formatDate value="${account.opentime}" type="both" pattern="yyyy年MMMM d日   EEEE   HH:mm:ss "/></td>
		</tr>
		<tr>
			<td>您现有资金：</td><td>￥${account.money}元</td>
				<c:if test="${sessionScope.user.account.memberId!=null}">
					<td><a class="easyui-linkbutton" data-options="iconCls:'icon-back'" href="javascript:;" id="btn6">充值</a></td> 
					<td><a class="easyui-linkbutton" data-options="iconCls:'icon-redo'" href="javascript:;" id="btn7">提现</a></td>
				</c:if>
		</tr>
		<tr>
			<td>您在本平台获利：</td><td  colspan="3">￥${account.earpprofit}元</td>
		</tr>
		<tr>
			<td>已外放资金：</td><td  colspan="3">￥${account.lend}元</td>
		</tr>
		<tr>
			<td>借款资金：</td><td  colspan="3">￥${account.loan}元</td>
		</tr>
		<tr>
			<td>流经账户资金：</td><td  colspan="3">￥${account.flow}元</td>
		</tr>
	</table>
</div>
</body>
</html>